package com.jd.sunny.java;

/**
 * @Description:
 * @author:sunlin
 * @since:2012-11-28 18:37
 * @version:1.0.0
 */
public class Person {

    private String name;
    private String sex;

    /**
     * object equals method
     * has consistent meaning , use instanceof  to check
     * @param object
     * @return
     */
    public boolean equals(Object object){
        if(this == object){
            return true;
        }
        if(object==null){
            return false;
        }
        if(!(object instanceof com.jd.sunny.java.Person)){
            return false;
        }
        com.jd.sunny.java.Person person = (com.jd.sunny.java.Person)object;
        return this.name.equals(person.getName()) && this.sex.equals(person.getSex());
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }
}
